\(\int \cot ^4(c+d x) \csc ^3(c+d x) (a+a \sin (c+d x))^2 \, dx\) [388]

   Optimal result
   Rubi [A] (verified)
   Mathematica [B] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F(-1)]
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 29, antiderivative size = 132 \[ \int \cot ^4(c+d x) \csc ^3(c+d x) (a+a \sin (c+d x))^2 \, dx=-\frac {7 a^2 \text {arctanh}(\cos (c+d x))}{16 d}-\frac {2 a^2 \cot ^5(c+d x)}{5 d}+\frac {5 a^2 \cot (c+d x) \csc (c+d x)}{16 d}-\frac {a^2 \cot ^3(c+d x) \csc (c+d x)}{4 d}+\frac {a^2 \cot (c+d x) \csc ^3(c+d x)}{8 d}-\frac {a^2 \cot ^3(c+d x) \csc ^3(c+d x)}{6 d} \]

[Out]

-7/16*a^2*arctanh(cos(d*x+c))/d-2/5*a^2*cot(d*x+c)^5/d+5/16*a^2*cot(d*x+c)*csc(d*x+c)/d-1/4*a^2*cot(d*x+c)^3*c
sc(d*x+c)/d+1/8*a^2*cot(d*x+c)*csc(d*x+c)^3/d-1/6*a^2*cot(d*x+c)^3*csc(d*x+c)^3/d

Rubi [A] (verified)

Time = 0.19 (sec) , antiderivative size = 132, normalized size of antiderivative = 1.00, number of steps used = 11, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.207, Rules used = {2952, 2691, 3855, 2687, 30, 3853} \[ \int \cot ^4(c+d x) \csc ^3(c+d x) (a+a \sin (c+d x))^2 \, dx=-\frac {7 a^2 \text {arctanh}(\cos (c+d x))}{16 d}-\frac {2 a^2 \cot ^5(c+d x)}{5 d}-\frac {a^2 \cot ^3(c+d x) \csc ^3(c+d x)}{6 d}-\frac {a^2 \cot ^3(c+d x) \csc (c+d x)}{4 d}+\frac {a^2 \cot (c+d x) \csc ^3(c+d x)}{8 d}+\frac {5 a^2 \cot (c+d x) \csc (c+d x)}{16 d} \]

[In]

Int[Cot[c + d*x]^4*Csc[c + d*x]^3*(a + a*Sin[c + d*x])^2,x]

[Out]

(-7*a^2*ArcTanh[Cos[c + d*x]])/(16*d) - (2*a^2*Cot[c + d*x]^5)/(5*d) + (5*a^2*Cot[c + d*x]*Csc[c + d*x])/(16*d
) - (a^2*Cot[c + d*x]^3*Csc[c + d*x])/(4*d) + (a^2*Cot[c + d*x]*Csc[c + d*x]^3)/(8*d) - (a^2*Cot[c + d*x]^3*Cs
c[c + d*x]^3)/(6*d)

Rule 30

Int[(x_)^(m_.), x_Symbol] :> Simp[x^(m + 1)/(m + 1), x] /; FreeQ[m, x] && NeQ[m, -1]

Rule 2687

Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[1/f, Subst[Int[(b*x)
^n*(1 + x^2)^(m/2 - 1), x], x, Tan[e + f*x]], x] /; FreeQ[{b, e, f, n}, x] && IntegerQ[m/2] &&  !(IntegerQ[(n
- 1)/2] && LtQ[0, n, m - 1])

Rule 2691

Int[((a_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[b*(a*Sec[e +
 f*x])^m*((b*Tan[e + f*x])^(n - 1)/(f*(m + n - 1))), x] - Dist[b^2*((n - 1)/(m + n - 1)), Int[(a*Sec[e + f*x])
^m*(b*Tan[e + f*x])^(n - 2), x], x] /; FreeQ[{a, b, e, f, m}, x] && GtQ[n, 1] && NeQ[m + n - 1, 0] && Integers
Q[2*m, 2*n]

Rule 2952

Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((d_.)*sin[(e_.) + (f_.)*(x_)])^(n_)*((a_) + (b_.)*sin[(e_.) + (f_.)*
(x_)])^(m_), x_Symbol] :> Int[ExpandTrig[(g*cos[e + f*x])^p, (d*sin[e + f*x])^n*(a + b*sin[e + f*x])^m, x], x]
 /; FreeQ[{a, b, d, e, f, g, n, p}, x] && EqQ[a^2 - b^2, 0] && IGtQ[m, 0]

Rule 3853

Int[(csc[(c_.) + (d_.)*(x_)]*(b_.))^(n_), x_Symbol] :> Simp[(-b)*Cos[c + d*x]*((b*Csc[c + d*x])^(n - 1)/(d*(n
- 1))), x] + Dist[b^2*((n - 2)/(n - 1)), Int[(b*Csc[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n,
 1] && IntegerQ[2*n]

Rule 3855

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps \begin{align*} \text {integral}& = \int \left (a^2 \cot ^4(c+d x) \csc (c+d x)+2 a^2 \cot ^4(c+d x) \csc ^2(c+d x)+a^2 \cot ^4(c+d x) \csc ^3(c+d x)\right ) \, dx \\ & = a^2 \int \cot ^4(c+d x) \csc (c+d x) \, dx+a^2 \int \cot ^4(c+d x) \csc ^3(c+d x) \, dx+\left (2 a^2\right ) \int \cot ^4(c+d x) \csc ^2(c+d x) \, dx \\ & = -\frac {a^2 \cot ^3(c+d x) \csc (c+d x)}{4 d}-\frac {a^2 \cot ^3(c+d x) \csc ^3(c+d x)}{6 d}-\frac {1}{2} a^2 \int \cot ^2(c+d x) \csc ^3(c+d x) \, dx-\frac {1}{4} \left (3 a^2\right ) \int \cot ^2(c+d x) \csc (c+d x) \, dx+\frac {\left (2 a^2\right ) \text {Subst}\left (\int x^4 \, dx,x,-\cot (c+d x)\right )}{d} \\ & = -\frac {2 a^2 \cot ^5(c+d x)}{5 d}+\frac {3 a^2 \cot (c+d x) \csc (c+d x)}{8 d}-\frac {a^2 \cot ^3(c+d x) \csc (c+d x)}{4 d}+\frac {a^2 \cot (c+d x) \csc ^3(c+d x)}{8 d}-\frac {a^2 \cot ^3(c+d x) \csc ^3(c+d x)}{6 d}+\frac {1}{8} a^2 \int \csc ^3(c+d x) \, dx+\frac {1}{8} \left (3 a^2\right ) \int \csc (c+d x) \, dx \\ & = -\frac {3 a^2 \text {arctanh}(\cos (c+d x))}{8 d}-\frac {2 a^2 \cot ^5(c+d x)}{5 d}+\frac {5 a^2 \cot (c+d x) \csc (c+d x)}{16 d}-\frac {a^2 \cot ^3(c+d x) \csc (c+d x)}{4 d}+\frac {a^2 \cot (c+d x) \csc ^3(c+d x)}{8 d}-\frac {a^2 \cot ^3(c+d x) \csc ^3(c+d x)}{6 d}+\frac {1}{16} a^2 \int \csc (c+d x) \, dx \\ & = -\frac {7 a^2 \text {arctanh}(\cos (c+d x))}{16 d}-\frac {2 a^2 \cot ^5(c+d x)}{5 d}+\frac {5 a^2 \cot (c+d x) \csc (c+d x)}{16 d}-\frac {a^2 \cot ^3(c+d x) \csc (c+d x)}{4 d}+\frac {a^2 \cot (c+d x) \csc ^3(c+d x)}{8 d}-\frac {a^2 \cot ^3(c+d x) \csc ^3(c+d x)}{6 d} \\ \end{align*}

Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(267\) vs. \(2(132)=264\).

Time = 0.27 (sec) , antiderivative size = 267, normalized size of antiderivative = 2.02 \[ \int \cot ^4(c+d x) \csc ^3(c+d x) (a+a \sin (c+d x))^2 \, dx=a^2 \left (-\frac {\cot \left (\frac {1}{2} (c+d x)\right )}{5 d}+\frac {9 \csc ^2\left (\frac {1}{2} (c+d x)\right )}{64 d}+\frac {7 \cot \left (\frac {1}{2} (c+d x)\right ) \csc ^2\left (\frac {1}{2} (c+d x)\right )}{80 d}-\frac {\cot \left (\frac {1}{2} (c+d x)\right ) \csc ^4\left (\frac {1}{2} (c+d x)\right )}{80 d}-\frac {\csc ^6\left (\frac {1}{2} (c+d x)\right )}{384 d}-\frac {7 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )}{16 d}+\frac {7 \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )}{16 d}-\frac {9 \sec ^2\left (\frac {1}{2} (c+d x)\right )}{64 d}+\frac {\sec ^6\left (\frac {1}{2} (c+d x)\right )}{384 d}+\frac {\tan \left (\frac {1}{2} (c+d x)\right )}{5 d}-\frac {7 \sec ^2\left (\frac {1}{2} (c+d x)\right ) \tan \left (\frac {1}{2} (c+d x)\right )}{80 d}+\frac {\sec ^4\left (\frac {1}{2} (c+d x)\right ) \tan \left (\frac {1}{2} (c+d x)\right )}{80 d}\right ) \]

[In]

Integrate[Cot[c + d*x]^4*Csc[c + d*x]^3*(a + a*Sin[c + d*x])^2,x]

[Out]

a^2*(-1/5*Cot[(c + d*x)/2]/d + (9*Csc[(c + d*x)/2]^2)/(64*d) + (7*Cot[(c + d*x)/2]*Csc[(c + d*x)/2]^2)/(80*d)
- (Cot[(c + d*x)/2]*Csc[(c + d*x)/2]^4)/(80*d) - Csc[(c + d*x)/2]^6/(384*d) - (7*Log[Cos[(c + d*x)/2]])/(16*d)
 + (7*Log[Sin[(c + d*x)/2]])/(16*d) - (9*Sec[(c + d*x)/2]^2)/(64*d) + Sec[(c + d*x)/2]^6/(384*d) + Tan[(c + d*
x)/2]/(5*d) - (7*Sec[(c + d*x)/2]^2*Tan[(c + d*x)/2])/(80*d) + (Sec[(c + d*x)/2]^4*Tan[(c + d*x)/2])/(80*d))

Maple [A] (verified)

Time = 0.34 (sec) , antiderivative size = 172, normalized size of antiderivative = 1.30

method result size
parallelrisch \(-\frac {\left (\cot ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )-\left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\frac {24 \left (\cot ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{5}-\frac {24 \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{5}+3 \left (\cot ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-3 \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-24 \left (\cot ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+24 \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-51 \left (\cot ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+51 \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+48 \cot \left (\frac {d x}{2}+\frac {c}{2}\right )-48 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-168 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )\right ) a^{2}}{384 d}\) \(172\)
risch \(-\frac {a^{2} \left (135 \,{\mathrm e}^{11 i \left (d x +c \right )}-445 \,{\mathrm e}^{9 i \left (d x +c \right )}+480 i {\mathrm e}^{10 i \left (d x +c \right )}-330 \,{\mathrm e}^{7 i \left (d x +c \right )}-480 i {\mathrm e}^{8 i \left (d x +c \right )}-330 \,{\mathrm e}^{5 i \left (d x +c \right )}+960 i {\mathrm e}^{6 i \left (d x +c \right )}-445 \,{\mathrm e}^{3 i \left (d x +c \right )}-960 i {\mathrm e}^{4 i \left (d x +c \right )}+135 \,{\mathrm e}^{i \left (d x +c \right )}+96 i {\mathrm e}^{2 i \left (d x +c \right )}-96 i\right )}{120 d \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{6}}+\frac {7 a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{16 d}-\frac {7 a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{16 d}\) \(192\)
derivativedivides \(\frac {a^{2} \left (-\frac {\cos ^{5}\left (d x +c \right )}{4 \sin \left (d x +c \right )^{4}}+\frac {\cos ^{5}\left (d x +c \right )}{8 \sin \left (d x +c \right )^{2}}+\frac {\left (\cos ^{3}\left (d x +c \right )\right )}{8}+\frac {3 \cos \left (d x +c \right )}{8}+\frac {3 \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{8}\right )-\frac {2 a^{2} \left (\cos ^{5}\left (d x +c \right )\right )}{5 \sin \left (d x +c \right )^{5}}+a^{2} \left (-\frac {\cos ^{5}\left (d x +c \right )}{6 \sin \left (d x +c \right )^{6}}-\frac {\cos ^{5}\left (d x +c \right )}{24 \sin \left (d x +c \right )^{4}}+\frac {\cos ^{5}\left (d x +c \right )}{48 \sin \left (d x +c \right )^{2}}+\frac {\left (\cos ^{3}\left (d x +c \right )\right )}{48}+\frac {\cos \left (d x +c \right )}{16}+\frac {\ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{16}\right )}{d}\) \(199\)
default \(\frac {a^{2} \left (-\frac {\cos ^{5}\left (d x +c \right )}{4 \sin \left (d x +c \right )^{4}}+\frac {\cos ^{5}\left (d x +c \right )}{8 \sin \left (d x +c \right )^{2}}+\frac {\left (\cos ^{3}\left (d x +c \right )\right )}{8}+\frac {3 \cos \left (d x +c \right )}{8}+\frac {3 \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{8}\right )-\frac {2 a^{2} \left (\cos ^{5}\left (d x +c \right )\right )}{5 \sin \left (d x +c \right )^{5}}+a^{2} \left (-\frac {\cos ^{5}\left (d x +c \right )}{6 \sin \left (d x +c \right )^{6}}-\frac {\cos ^{5}\left (d x +c \right )}{24 \sin \left (d x +c \right )^{4}}+\frac {\cos ^{5}\left (d x +c \right )}{48 \sin \left (d x +c \right )^{2}}+\frac {\left (\cos ^{3}\left (d x +c \right )\right )}{48}+\frac {\cos \left (d x +c \right )}{16}+\frac {\ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{16}\right )}{d}\) \(199\)
norman \(\frac {-\frac {a^{2}}{384 d}-\frac {a^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{80 d}-\frac {5 a^{2} \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{384 d}+\frac {3 a^{2} \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{80 d}+\frac {11 a^{2} \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{96 d}-\frac {a^{2} \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{80 d}-\frac {a^{2} \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{16 d}+\frac {a^{2} \left (\tan ^{9}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{16 d}+\frac {a^{2} \left (\tan ^{11}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{80 d}-\frac {11 a^{2} \left (\tan ^{12}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{96 d}-\frac {3 a^{2} \left (\tan ^{13}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{80 d}+\frac {5 a^{2} \left (\tan ^{14}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{384 d}+\frac {a^{2} \left (\tan ^{15}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{80 d}+\frac {a^{2} \left (\tan ^{16}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{384 d}+\frac {33 a^{2} \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{64 d}+\frac {33 a^{2} \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{64 d}}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6} \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{2}}+\frac {7 a^{2} \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{16 d}\) \(339\)

[In]

int(cos(d*x+c)^4*csc(d*x+c)^7*(a+a*sin(d*x+c))^2,x,method=_RETURNVERBOSE)

[Out]

-1/384*(cot(1/2*d*x+1/2*c)^6-tan(1/2*d*x+1/2*c)^6+24/5*cot(1/2*d*x+1/2*c)^5-24/5*tan(1/2*d*x+1/2*c)^5+3*cot(1/
2*d*x+1/2*c)^4-3*tan(1/2*d*x+1/2*c)^4-24*cot(1/2*d*x+1/2*c)^3+24*tan(1/2*d*x+1/2*c)^3-51*cot(1/2*d*x+1/2*c)^2+
51*tan(1/2*d*x+1/2*c)^2+48*cot(1/2*d*x+1/2*c)-48*tan(1/2*d*x+1/2*c)-168*ln(tan(1/2*d*x+1/2*c)))*a^2/d

Fricas [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 211, normalized size of antiderivative = 1.60 \[ \int \cot ^4(c+d x) \csc ^3(c+d x) (a+a \sin (c+d x))^2 \, dx=\frac {192 \, a^{2} \cos \left (d x + c\right )^{5} \sin \left (d x + c\right ) - 270 \, a^{2} \cos \left (d x + c\right )^{5} + 560 \, a^{2} \cos \left (d x + c\right )^{3} - 210 \, a^{2} \cos \left (d x + c\right ) - 105 \, {\left (a^{2} \cos \left (d x + c\right )^{6} - 3 \, a^{2} \cos \left (d x + c\right )^{4} + 3 \, a^{2} \cos \left (d x + c\right )^{2} - a^{2}\right )} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) + 105 \, {\left (a^{2} \cos \left (d x + c\right )^{6} - 3 \, a^{2} \cos \left (d x + c\right )^{4} + 3 \, a^{2} \cos \left (d x + c\right )^{2} - a^{2}\right )} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right )}{480 \, {\left (d \cos \left (d x + c\right )^{6} - 3 \, d \cos \left (d x + c\right )^{4} + 3 \, d \cos \left (d x + c\right )^{2} - d\right )}} \]

[In]

integrate(cos(d*x+c)^4*csc(d*x+c)^7*(a+a*sin(d*x+c))^2,x, algorithm="fricas")

[Out]

1/480*(192*a^2*cos(d*x + c)^5*sin(d*x + c) - 270*a^2*cos(d*x + c)^5 + 560*a^2*cos(d*x + c)^3 - 210*a^2*cos(d*x
 + c) - 105*(a^2*cos(d*x + c)^6 - 3*a^2*cos(d*x + c)^4 + 3*a^2*cos(d*x + c)^2 - a^2)*log(1/2*cos(d*x + c) + 1/
2) + 105*(a^2*cos(d*x + c)^6 - 3*a^2*cos(d*x + c)^4 + 3*a^2*cos(d*x + c)^2 - a^2)*log(-1/2*cos(d*x + c) + 1/2)
)/(d*cos(d*x + c)^6 - 3*d*cos(d*x + c)^4 + 3*d*cos(d*x + c)^2 - d)

Sympy [F(-1)]

Timed out. \[ \int \cot ^4(c+d x) \csc ^3(c+d x) (a+a \sin (c+d x))^2 \, dx=\text {Timed out} \]

[In]

integrate(cos(d*x+c)**4*csc(d*x+c)**7*(a+a*sin(d*x+c))**2,x)

[Out]

Timed out

Maxima [A] (verification not implemented)

none

Time = 0.23 (sec) , antiderivative size = 181, normalized size of antiderivative = 1.37 \[ \int \cot ^4(c+d x) \csc ^3(c+d x) (a+a \sin (c+d x))^2 \, dx=\frac {5 \, a^{2} {\left (\frac {2 \, {\left (3 \, \cos \left (d x + c\right )^{5} + 8 \, \cos \left (d x + c\right )^{3} - 3 \, \cos \left (d x + c\right )\right )}}{\cos \left (d x + c\right )^{6} - 3 \, \cos \left (d x + c\right )^{4} + 3 \, \cos \left (d x + c\right )^{2} - 1} - 3 \, \log \left (\cos \left (d x + c\right ) + 1\right ) + 3 \, \log \left (\cos \left (d x + c\right ) - 1\right )\right )} - 30 \, a^{2} {\left (\frac {2 \, {\left (5 \, \cos \left (d x + c\right )^{3} - 3 \, \cos \left (d x + c\right )\right )}}{\cos \left (d x + c\right )^{4} - 2 \, \cos \left (d x + c\right )^{2} + 1} + 3 \, \log \left (\cos \left (d x + c\right ) + 1\right ) - 3 \, \log \left (\cos \left (d x + c\right ) - 1\right )\right )} - \frac {192 \, a^{2}}{\tan \left (d x + c\right )^{5}}}{480 \, d} \]

[In]

integrate(cos(d*x+c)^4*csc(d*x+c)^7*(a+a*sin(d*x+c))^2,x, algorithm="maxima")

[Out]

1/480*(5*a^2*(2*(3*cos(d*x + c)^5 + 8*cos(d*x + c)^3 - 3*cos(d*x + c))/(cos(d*x + c)^6 - 3*cos(d*x + c)^4 + 3*
cos(d*x + c)^2 - 1) - 3*log(cos(d*x + c) + 1) + 3*log(cos(d*x + c) - 1)) - 30*a^2*(2*(5*cos(d*x + c)^3 - 3*cos
(d*x + c))/(cos(d*x + c)^4 - 2*cos(d*x + c)^2 + 1) + 3*log(cos(d*x + c) + 1) - 3*log(cos(d*x + c) - 1)) - 192*
a^2/tan(d*x + c)^5)/d

Giac [A] (verification not implemented)

none

Time = 0.43 (sec) , antiderivative size = 229, normalized size of antiderivative = 1.73 \[ \int \cot ^4(c+d x) \csc ^3(c+d x) (a+a \sin (c+d x))^2 \, dx=\frac {5 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{6} + 24 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 15 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 120 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 255 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 840 \, a^{2} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right ) + 240 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \frac {2058 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{6} + 240 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 255 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 120 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 15 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 24 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 5 \, a^{2}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{6}}}{1920 \, d} \]

[In]

integrate(cos(d*x+c)^4*csc(d*x+c)^7*(a+a*sin(d*x+c))^2,x, algorithm="giac")

[Out]

1/1920*(5*a^2*tan(1/2*d*x + 1/2*c)^6 + 24*a^2*tan(1/2*d*x + 1/2*c)^5 + 15*a^2*tan(1/2*d*x + 1/2*c)^4 - 120*a^2
*tan(1/2*d*x + 1/2*c)^3 - 255*a^2*tan(1/2*d*x + 1/2*c)^2 + 840*a^2*log(abs(tan(1/2*d*x + 1/2*c))) + 240*a^2*ta
n(1/2*d*x + 1/2*c) - (2058*a^2*tan(1/2*d*x + 1/2*c)^6 + 240*a^2*tan(1/2*d*x + 1/2*c)^5 - 255*a^2*tan(1/2*d*x +
 1/2*c)^4 - 120*a^2*tan(1/2*d*x + 1/2*c)^3 + 15*a^2*tan(1/2*d*x + 1/2*c)^2 + 24*a^2*tan(1/2*d*x + 1/2*c) + 5*a
^2)/tan(1/2*d*x + 1/2*c)^6)/d

Mupad [B] (verification not implemented)

Time = 11.22 (sec) , antiderivative size = 339, normalized size of antiderivative = 2.57 \[ \int \cot ^4(c+d x) \csc ^3(c+d x) (a+a \sin (c+d x))^2 \, dx=\frac {a^2\,\left (5\,{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{12}-5\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{12}+24\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{11}-24\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{11}\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )+15\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}-120\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^9-255\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8+240\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5\,{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7-240\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7\,{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+255\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8\,{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+120\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^9\,{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3-15\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}\,{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+840\,\ln \left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6\,{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6\right )}{1920\,d\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6\,{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6} \]

[In]

int((cos(c + d*x)^4*(a + a*sin(c + d*x))^2)/sin(c + d*x)^7,x)

[Out]

(a^2*(5*sin(c/2 + (d*x)/2)^12 - 5*cos(c/2 + (d*x)/2)^12 + 24*cos(c/2 + (d*x)/2)*sin(c/2 + (d*x)/2)^11 - 24*cos
(c/2 + (d*x)/2)^11*sin(c/2 + (d*x)/2) + 15*cos(c/2 + (d*x)/2)^2*sin(c/2 + (d*x)/2)^10 - 120*cos(c/2 + (d*x)/2)
^3*sin(c/2 + (d*x)/2)^9 - 255*cos(c/2 + (d*x)/2)^4*sin(c/2 + (d*x)/2)^8 + 240*cos(c/2 + (d*x)/2)^5*sin(c/2 + (
d*x)/2)^7 - 240*cos(c/2 + (d*x)/2)^7*sin(c/2 + (d*x)/2)^5 + 255*cos(c/2 + (d*x)/2)^8*sin(c/2 + (d*x)/2)^4 + 12
0*cos(c/2 + (d*x)/2)^9*sin(c/2 + (d*x)/2)^3 - 15*cos(c/2 + (d*x)/2)^10*sin(c/2 + (d*x)/2)^2 + 840*log(sin(c/2
+ (d*x)/2)/cos(c/2 + (d*x)/2))*cos(c/2 + (d*x)/2)^6*sin(c/2 + (d*x)/2)^6))/(1920*d*cos(c/2 + (d*x)/2)^6*sin(c/
2 + (d*x)/2)^6)